package cn.tx.service.impl.annotation.enums;

public enum BusinessType {

    ADD("新增", (byte)1),
    UPDATE("更新", (byte)2),
    DELETE("删除", (byte)3),
    OTHER("其他", (byte)4),
    ;

    private final String name;
    private final byte value;

    BusinessType(String name, byte value) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public byte getValue() {
        return value;
    }

    public static BusinessType getType(int value) {
        for(BusinessType type: values()) {
            if(type.value == value) {
                return type;
            }
        }
        return null;
    }

}
